//
//  HXNetTool.h
//  ZCooking
//
//  Created by 韩旭 on 16/8/29.
//  Copyright © 2016年 HX_. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef void (^blockOfSuccess)(id result);
typedef void (^blockOfFailure)(NSError *error);

typedef NS_ENUM(NSUInteger, HXResponeseStyle) {
    HXJSON,
    HXDATA,
    HXXML,
};
typedef NS_ENUM(NSUInteger, HXRequestStyle) {
    HXBodyJSON,
    HXBodyString,
};
@interface HXNetTool : NSObject
+ (void)getNetWithUrl:(NSString *)url
                 body:(id)body
               Header:(NSDictionary *)header
             Response:(HXResponeseStyle)response
              Success:(blockOfSuccess)success
              Failure:(blockOfFailure)failure;

+ (void)postNetWithUrl:(NSString *)url
                  body:(id)body
             BodyStyle:(HXRequestStyle)bodyStyle
                Header:(NSDictionary *)header
              Response:(HXResponeseStyle)response
               Success:(blockOfSuccess)success
               Failure:(blockOfFailure)failure;

@end
